home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hyper Stacks 1994 May
/
Hyper Stacks (Pacific HiTech)(1994)[Mac].iso
/
Utilities
/
Print the Scripts
/
cards.xml
< prev
next >
Wrap
Text File
|
1994-04-30
|
9KB
|
22 lines
card_2817.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<card>
<id>2817</id>
<filler1>0</filler1>
<cantDelete> <false /> </cantDelete>
<showPict> <true /> </showPict>
<dontSearch> <false /> </dontSearch>
<owner>2712</owner>
<link rel="stylesheet" type="text/css" href="stylesheet_3268.css" />
<content>
<layer>background</layer>
<id>1</id>
<text><span class="style4">rintTheScripts</span><span class="style1">©1991 Richard Crispin. All Rights Reserved.May be freely used and given away but not sold, alone or as part of a collection, without the author's written permission. User Groups registered with Apple may distribute this as part of one or more software collections.</span><span class="style3">How to Use This Stack</span><span class="style1">This is a HyperCard 2.0 stack. It is designed to be used from within another stack. To use the scripts it contains type the following command into the message box: START USING STACK "PRINT THE SCRIPTS"To start the process type the following command into the message box: PrintTheScriptsNOTE: Currently the setting for the number of scripts per page is ignored. If a script will fit on a page it is put on the page. You should not ask for the script to be printed. This does not work well since the print mechanism doesn't recognize form feeds.</span><span class="style3">Purpose of This Stack</span><span class="style1">There are 2 useful functions provided by PrintTheScripts. First, it will search the current stack for all of the Handler/Function scripts, catalogues them and outputs the catalogue and the scripts. Included at the beginning of the output will be 2 lists of all the handlers and functions. The first is in the order they were incountered, while the second is in alphabetical order. The scripts can be sent directly to a printer (not recommended since it works poorly) and/or dumped into a file. This file can be read into something like WORD and formated to produce an organized and formated listing of all your scripts and handlers. Second, It will produce a report on all your global variables. There are actually 2 reports. The first is by variable and indicates all of the handlers/functions where the variable is defined. The second is by handler and indicates all the globals defined in the handler. If an "*" appears in the entry then the handler has defined the global but may not be actually using it in the script itself. This last check is not full proof i.e. a global may not get flagged when it should be. The order of the report is Table of Contents by order of handler/function occurance Table of Contents by handler/function name List of Globals by variable Name List of Globals by handler/function name The handler/function scripts</span><span class="style3">How It Works</span><span class="style1">The programme when called will fake a dialogue box that covers the entire card window. This dialogue box will let you pick where the output should go i.e. to a printer and/or a file (printer does not work well), and exactly what you want processed i.e. the stack scripts, backgrounds, etc. The programme will not process individual card scripts or scripts in card fields or card buttons. When you click on the "Done Setup" button in the bottom right corner the programme will delete the dialogue box and start processing the scripts. It will report in the message box exactly what it is doing. These messages are also saved to a Log file that can be output.</span><span class="style3">Global Variables Used</span><span class="style1">The programme creates and uses a number of Global Variables. The following is a description of these:</span><span class="style3">theScript</span><span class="style1"> - contains the currently active script</span><span class="style3">thePrintIndex</span><span class="style1"> - contains the index for all of the handles etc. being printed</span><span class="style3">theOutputFile</span><span class="style1"> - This is where the output is stored. This is either printed or written to a file or both</span><span class="style3">thePrintLog</span><span class="style1"> - This contains all the messages produced by the printing process. It is saved to a file at the end so the process can be checked</span><span class="style3">theGlobals</span><span class="style1"> - This contains a list of all the global variables with the handlers/functions that have these declared in it. It also records whether the variable is actually used in the handler/function.</span><span class="style3">PrintScriptSettings</span><span class="style1"> - This is used to keep track of the settings chosen in the dialogue box as well as several values that are modified as the script progresses. The following is how this is layed out.-- Item 1: the number of scripts per page-- Item 2: the the Name of the Stack-- Item 3: the name of the current background-- Item 4: The name of the OutPut File-- Item 5: the name of the container (field or button)-- Item 6: True or false for Print and put in text file-- Item 7: Onhandler will be true or false-- Item 8: FunctionHandler will be true or false-- Item 9: the Name of the script that is returned-- Item 10: the length of outscript-- Item 11: the number of the script-- Item 12: the print header-- Item 13: DoStack-- Item 14: Number of backgrounds and True or False for each background-- Item 15 to Item 15 + number of backgrounds:-- True and false for Background Fields and Buttons for each background</span><span class="style3">Scripts Used</span><span class="style1">The following handlers and function are used:</span><span class="style3">PrintTheScripts</span><span class="style1"> - This creates the dialogue box and sets up its fields and buttons based on the stack that it was called from.</span><span class="style3">DoSetUpButtons</span><span class="style1"> - This is used by PrintTheScripts. It formats the buttons so they appear correctly across the card window.</span><span class="style3">DeleteExtras</span><span class="style1"> - After clickon on the "Done Setup" button, this script will delete the extra fields and buttons that "PrintTheScripts" created.</span><span class="style3">GetPrintScriptsSetup</span><span class="style1"> - This retrieves the settings set up by the user in the dialogue box.</span><span class="style3">NowPrintTheScripts</span><span class="style1"> - This is the master programme for getting the scripts and outputing the results.</span><span class="style3">ProcessScript</span><span class="style1"> - This processes each script. It separates the handlers/functions and sets up the table of contents.</span><span class="style3">CheckGlobals</span><span class="style1"> - This is called by "Process Script" and gets the defined globals from the handler/function and insures that they are entered into the global index.</span><span class="style3">LogMsg</span><span class="style1"> - This puts the message into the message box and records the message (along with the time and date) into the log file</span><span class="style3">SeparateScript</span><span class="style1"> - This is the only function. If you pass it a script it will return the first handler/function that it incounters. </span><span class="style3">Conclusion</span><span class="style1">This software is provided free of charge. I hope you find it useful. There is no warranty as to the actual safety of the associated scripts. I have used this with stacks both small (this stack) and large (200K of scripts) and it has worked fine. I have lots of memory on my machine and I have alotted lots of memory for Hypercard. I have not tested this on a machine with only a couple of megs of memory.I think I have stomped out all the bugs. If you find one or you have a suggestion on an improvement let me know (address is below). I will not guarantee that I will be able to do anything about it but I would like to know. I can be contacted at one of the following:MAIL Work:Department of PsychologyUniversity of WaterlooWaterloo, Ont.Canada N2L 3G1Home:#7-590 Bearinger Rd.Waterloo, Ont.Canada N2L 6C4User Group:WatRMUG (Waterloo Region Macintosh User Group)P.O. Box 993Waterloo, Ont.Canada N2L 4S1TELEPHONEWork: (519)888-4781 or (519)885-1211 ext. 4781Home: (519)885-3560Fax:(519)746-8631EMAILpsych@watserv1.uwaterloo.capsych@watdcs.uwaterloo.caHave FunRichard Crispin</span></text>
</content>
<name></name>
<script></script>
</card>